<template>
  <div>
    <el-row >
      <el-form ref="elForm" :model="formData"   size="mini" label-width="100px">
      
            <el-col :span="8">
              <el-form-item label="平台类型" prop="adtype">
                <el-select v-model="formData.adtype" placeholder="全部" 
                v-on:change="submitForm" :style="{width: '60%'}">
                  <el-option v-for="(item, index) in adtypeOptions" :key="index" :label="item.label"
                    :value="item.value" :disabled="item.disabled"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
        
            <el-col :span="8">
              <el-form-item label="状态" prop="status">
                <el-select v-model="formData.status" placeholder="全部"  
                v-on:change="submitForm" :style="{width: '60%'}">
                  <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.label"
                    :value="item.value" :disabled="item.disabled"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
      
            <el-col :span="8">
              <el-form-item label="广告类型" prop="placeType">
                <el-select v-model="formData.placeType" placeholder="全部"
                  v-on:change="submitForm" :style="{width: '60%'}">
                  <el-option v-for="(item, index) in placeTypeOptions" :key="index" :label="item.label"
                    :value="item.value" :disabled="item.disabled"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
       
        <el-col :span="8">
              <el-form-item label="尺寸" prop="adsize">
                <el-select v-model="formData.adsize" placeholder="全部"
                  v-on:change="submitForm" :style="{width: '60%'}">
                  <el-option v-for="(item, index) in adsizeOptions" :key="index" :label="item.label"
                    :value="item.value" :disabled="item.disabled"></el-option>
                </el-select>
              </el-form-item>
            </el-col>

             <el-col :span="8">
              <el-form-item label="使用情况" prop="adused">
                <el-select v-model="formData.adused" placeholder="全部"
                  v-on:change="submitForm" :style="{width: '60%'}">
                  <el-option v-for="(item, index) in adusedOptions" :key="index" :label="item.label"
                    :value="item.value" :disabled="item.disabled"></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <el-form-item label="标签" prop="adtags">
                 <el-input v-model="formData.adtags" 
                  placeholder="请输入标签关键词"
                  clearable 
                  v-on:change="submitForm" 
                  :style="{width: '100%'}">
                  </el-input>

                <!-- <el-select v-model="formData.adtags" placeholder="全部"
                multiple
                filterable 
                v-on:change="submitForm"  :style="{width: '100%'}">
                  <el-option v-for="(item, index) in adtagsOptions" :key="index" :label="item.label"
                    :value="item.value" :disabled="item.disabled"></el-option>
                </el-select> -->
              </el-form-item>
            </el-col>

      </el-form>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
       
        placeType: 0,
        status: 0,
        adtype: 0,
        adsize:0,
        adused:0,
        adtags: undefined
      },
       
      adtypeOptions: [{
        "label": "全部",
        "value": 0
      }, {
        "label": "PC",
        "value": 1
      }, {
        "label": "移动",
        "value": 2
      }, {
        "label": "APP",
        "value": 3
      }],
      statusOptions: [{
        "label": "全部",
        "value": 0
      }, {
        "label": "删除",
        "value": 1
      }, {
        "label": "启用",
        "value": 2
      }, {
        "label": "停用",
        "value": 3
      }],
      placeTypeOptions: [{
        "label": "全部",
        "value": 0
      }, {
        "label": "嵌入",
        "value": 1
      }, {
        "label": "悬浮",
        "value": 2
      }, {
        "label": "开屏",
        "value": 3
      }, {
        "label": "信息流",
        "value": 4
      }],
      adsizeOptions: [{
       "label": "全部",
        "value": 0  
      }],
      adusedOptions: [{
       "label": "全部",
        "value": 0  
      }],
      adtagsOptions: [{
       "label": "全部",
        "value": 0  
      },{
       "label": "首页",
        "value": 1  
      },{
       "label": "PC底部",
        "value": 2  
      }]
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      //每个下拉框改变值都触发
      this.$emit("onselectchange", this.formData)
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
